package ${package.Entity};

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
<#list table.importPackages as imp>
import ${imp};
</#list>

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

/**
 * @Title: ${entity}
 * @description: ${table.comment}实体类
 * @author: ${author}
 * @since: ${date}
 */
@ApiModel(value = "${table.name}", description = "${table.comment}")
@TableName(value = "${table.name}")
@Data
public class ${entity} extends BaseModel<${entity}>{
	private static final long serialVersionUID = 1L;
	
	<#assign columns = table.fields />
	<#list columns as column>
		<#assign chnName=column.comment/>
		<#assign fieldName=column.propertyName/>
		<#assign fieldType=column.propertyType/>
		<#assign columnName=column.name/>
		<#assign primary=column.keyFlag/>
	/**
	 * ${chnName}
	 */
	@ApiModelProperty(value = "${chnName}", notes = "${chnName}")
	<#if primary = true>
	@TableId(value="${columnName}")
	<#else>
		<#if columnName == 'createTime' || columnName == 'createBy' || columnName == 'create_time' || columnName == 'create_by'>
	@TableField(value="${columnName}", fill=FieldFill.INSERT)
		<#elseif columnName == 'updateTime' || columnName == 'updateBy' || columnName == 'update_by' || columnName == 'update_time'>
	@TableField(value="${columnName}", fill=FieldFill.UPDATE)
		<#else>
	@TableField(value="${columnName}")	
		</#if>
	</#if>
	<#if fieldType=='Date' || fieldType=='LocalDateTime'|| fieldType=='LocalTime'|| fieldType=='LocalDate' >
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date ${fieldName};
	<#else>
	private ${fieldType} ${fieldName};
	</#if>

	<#if fieldType=='Date' || fieldType=='LocalDateTime'|| fieldType=='LocalTime'|| fieldType=='LocalDate'>
	/**
	* ${chnName}Start
	*/
	@ApiModelProperty(value = "${chnName}Start", notes = "${chnName}Start")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@TableField(value="${columnName}",exist = false)
	private Date ${fieldName}Start;

	/**
	* ${chnName}End
	*/
	@ApiModelProperty(value = "${chnName}End", notes = "${chnName}End")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@TableField(value="${columnName}",exist = false)
	private Date ${fieldName}End;
	</#if>

	</#list>

}
